using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PerkHighMomentum:Perk {
	void ShotEventHandler(object _sender,ShootEventArgs e) {
		Weapon sender = _sender as Weapon;
		if(sender==null) return;
		if(sender.owner!=Player.instance) return;
		e.stat.recoil.AddMultiply(1.5f,0);
	}
	void ProjectileFiredEventHandler(object _sender,ProjectileEventArgs e) {
		Projectile sender = _sender as Projectile;
		if(sender==null) return;
		if(e.shooterMob!=Player.instance) return;
		sender.stat.speed.AddMultiply(1.5f,0);
	}

	protected override void SubscribeEvents() {
		base.SubscribeEvents();
		Weapon.Shot+=ShotEventHandler;
		Projectile.ProjectileFired+=ProjectileFiredEventHandler;
	}
	protected override void UnSubscribeEvents() {
		base.UnSubscribeEvents();
		Weapon.Shot-=ShotEventHandler;
		Projectile.ProjectileFired-=ProjectileFiredEventHandler;
	}
}